<script>on upDateput cd fld "Model" into meend upDate</script>
</part>
<part>
<id>2</id>
<type>button</type>
<visible> <true /> </visible>
<reserved5> 0 </reserved5>
<reserved4> 0 </reserved4>
<reserved3> 0 </reserved3>
<reserved2> 0 </reserved2>
<reserved1> 0 </reserved1>
<enabled> <true /> </enabled>
<rect>
<left>180</left>
<top>67</top>
<right>196</right>
<bottom>92</bottom>
</rect>
<style>rectangle</style>
<showName> <false /> </showName>
<highlight> <false /> </highlight>
<autoHighlight> <true /> </autoHighlight>
<sharedHighlight> <true /> </sharedHighlight>
<family>0</family>
<titleWidth>0</titleWidth>
<icon>16692</icon>
<textAlign>center</textAlign>
<font>Chicago</font>
<textSize>12</textSize>
<textStyle>plain</textStyle>
<name></name>
<script>on mouseUpsend "increment" to cd fld "model"end mouseUp</script>
</part>
<part>
<id>3</id>
<type>button</type>
<visible> <true /> </visible>
<reserved5> 0 </reserved5>
<reserved4> 0 </reserved4>
<reserved3> 0 </reserved3>
<reserved2> 0 </reserved2>
<reserved1> 0 </reserved1>
<enabled> <true /> </enabled>
<rect>
<left>180</left>
<top>96</top>
<right>196</right>
<bottom>120</bottom>
</rect>
<style>rectangle</style>
<showName> <false /> </showName>
<highlight> <false /> </highlight>
<autoHighlight> <true /> </autoHighlight>
<sharedHighlight> <true /> </sharedHighlight>
<family>0</family>
<titleWidth>0</titleWidth>
<icon>3584</icon>
<textAlign>center</textAlign>
<font>Chicago</font>
<textSize>12</textSize>
<textStyle>plain</textStyle>
<name></name>
<script>on mouseUpsend "decrement" to cd fld modelend mouseUp</script>
</part>
<part>
<id>4</id>
<type>button</type>
<visible> <true /> </visible>
<reserved5> 0 </reserved5>
<reserved4> 0 </reserved4>
<reserved3> 0 </reserved3>
<reserved2> 0 </reserved2>
<reserved1> 0 </reserved1>
<enabled> <true /> </enabled>
<rect>
<left>132</left>
<top>153</top>
<right>212</right>
<bottom>170</bottom>
</rect>
<style>opaque</style>
<showName> <false /> </showName>
<highlight> <true /> </highlight>
<autoHighlight> <false /> </autoHighlight>
<sharedHighlight> <true /> </sharedHighlight>
<family>0</family>
<titleWidth>0</titleWidth>
<icon>0</icon>
<textAlign>center</textAlign>
<font>Chicago</font>
<textSize>12</textSize>
<textStyle>plain</textStyle>
<name>bar view</name>
<script>on UpDateput card field "Model" into counterValueset width of me to abs(10*counterValue)if counterValue ≥ 0 thenset left of me to left of cd button "Bar index"send "newX" && right of me to cd button "Bar Controller"elseset right of me to left of cd button "Bar index"send "newX" && left of me to cd button "Bar Controller"end ifend UpDate</script>
</part>
<part>
<id>5</id>
<type>field</type>
<visible> <true /> </visible>
<dontWrap> <false /> </dontWrap>
<dontSearch> <false /> </dontSearch>
<sharedText> <false /> </sharedText>
<fixedLineHeight> <false /> </fixedLineHeight>
<autoTab> <false /> </autoTab>
<lockText> <false /> </lockText>
<rect>
<left>325</left>
<top>117</top>
<right>510</right>
<bottom>247</bottom>
</rect>
<style>transparent</style>
<autoSelect> <false /> </autoSelect>
<showLines> <false /> </showLines>
<wideMargins> <false /> </wideMargins>
<multipleLines> <false /> </multipleLines>
<reservedFamily> 0 </reservedFamily>
<titleWidth>0</titleWidth>
<icon>0</icon>
<textAlign>left</textAlign>
<font>Geneva</font>
<textSize>10</textSize>
<textStyle>plain</textStyle>
<textHeight>13</textHeight>
<name>Dependent views</name>
<script>on doUpdatesrepeat with i = 1 to number of lines of meif line i of me is empty or char 1 of line i of me is "-" thennext repeatend ifselect line i of mesend "Update" to line i of meend repeatend doUpdates</script>
</part>
<part>
<id>6</id>
<type>field</type>
<visible> <true /> </visible>
<dontWrap> <false /> </dontWrap>
<dontSearch> <false /> </dontSearch>
<sharedText> <false /> </sharedText>
<fixedLineHeight> <false /> </fixedLineHeight>
<autoTab> <false /> </autoTab>
<lockText> <true /> </lockText>
<rect>
<left>434</left>
<top>65</top>
<right>482</right>
<bottom>85</bottom>
</rect>
<style>transparent</style>
<autoSelect> <false /> </autoSelect>
<showLines> <false /> </showLines>
<wideMargins> <true /> </wideMargins>
<multipleLines> <false /> </multipleLines>
<reservedFamily> 0 </reservedFamily>
<titleWidth>0</titleWidth>
<icon>0</icon>
<textAlign>right</textAlign>
<font>Geneva</font>
<textSize>10</textSize>
<textStyle>bold</textStyle>
<textHeight>13</textHeight>
<name>Model</name>
<script>on incrementadd 1 to mesend "doUpdates" to cd field "Dependent views"end incrementon decrementsubtract 1 from mesend "doUpdates" to cd field "Dependent views"end decrementon setValue nif n Γëá me thenput n into mesend "doUpdates" to cd field "Dependent views"end ifend setValue</script>
</part>
<part>
<id>7</id>
<type>button</type>
<visible> <true /> </visible>
<reserved5> 0 </reserved5>
<reserved4> 0 </reserved4>
<reserved3> 0 </reserved3>
<reserved2> 0 </reserved2>
<reserved1> 0 </reserved1>
<enabled> <true /> </enabled>
<rect>
<left>201</left>
<top>175</top>
<right>223</right>
<bottom>198</bottom>
</rect>
<style>rectangle</style>
<showName> <false /> </showName>
<highlight> <false /> </highlight>
<autoHighlight> <true /> </autoHighlight>
<sharedHighlight> <true /> </sharedHighlight>
<family>0</family>
<titleWidth>0</titleWidth>
<icon>26020</icon>
<textAlign>center</textAlign>
<font>Chicago</font>
<textSize>12</textSize>
<textStyle>plain</textStyle>
<name>Bar controller</name>
<script>on mouseDownrepeat until the mouse is upput item 1 of mouseloc() into XnewX Xsend "feedback" && X to cd fld "bar feedback"end repeatsend "feedback" to cd fld "bar feedback"put (X-left of cd button "bar index") DIV 10 into newValsend "SetValue" && newVal to cd fld "Model"end mouseDownon newX Xget loc of meput X into item 1 of itset loc of me to itsend "newLeft" && right of me-1 to cd fld "bar feedback"end newX</script>
</part>
<part>
<id>9</id>
<type>button</type>
<visible> <true /> </visible>
<reserved5> 0 </reserved5>
<reserved4> 0 </reserved4>
<reserved3> 0 </reserved3>
<reserved2> 0 </reserved2>
<reserved1> 0 </reserved1>
<enabled> <true /> </enabled>
<rect>
<left>132</left>
<top>176</top>
<right>133</right>
<bottom>194</bottom>
</rect>
<style>transparent</style>
<showName> <false /> </showName>
<highlight> <true /> </highlight>
<autoHighlight> <false /> </autoHighlight>
<sharedHighlight> <true /> </sharedHighlight>
<family>0</family>
<titleWidth>0</titleWidth>
<icon>0</icon>
<textAlign>center</textAlign>
<font>Chicago</font>
<textSize>12</textSize>
<textStyle>plain</textStyle>
<name>Bar index</name>
<script></script>
</part>
<part>
<id>10</id>
<type>button</type>
<visible> <true /> </visible>
<reserved5> 0 </reserved5>
<reserved4> 0 </reserved4>
<reserved3> 0 </reserved3>
<reserved2> 0 </reserved2>
<reserved1> 0 </reserved1>
<enabled> <true /> </enabled>
<rect>
<left>127</left>
<top>278</top>
<right>139</right>
<bottom>290</bottom>
</rect>
<style>roundrect</style>
<showName> <false /> </showName>
<highlight> <false /> </highlight>
<autoHighlight> <false /> </autoHighlight>
<sharedHighlight> <true /> </sharedHighlight>
<family>0</family>
<titleWidth>0</titleWidth>
<icon>0</icon>
<textAlign>center</textAlign>
<font>Chicago</font>
<textSize>12</textSize>
<textStyle>plain</textStyle>
<name>dial view</name>
<script>on upDateset cursor to busylock Screenput (4*(cd field "Model")-90)/180*3.142 into Aput item 1 of loc of me into xput item 2 of loc of me into ychoose select tooldrag from x-52, y-52 to x+52, y+52domenu "Clear picture"choose line toolset linesize to 2drag from x,y to trunc(x+50*cos(A)),trunc(y+50*sin(A))choose browse toolend upDate</script>
</part>
<part>
<id>12</id>
<type>button</type>
<visible> <true /> </visible>
<reserved5> 0 </reserved5>
<reserved4> 0 </reserved4>
<reserved3> 0 </reserved3>
<reserved2> 0 </reserved2>
<reserved1> 0 </reserved1>
<enabled> <true /> </enabled>
<rect>
<left>6</left>
<top>5</top>
<right>29</right>
<bottom>27</bottom>
</rect>
<style>opaque</style>
<showName> <false /> </showName>
<highlight> <false /> </highlight>
<autoHighlight> <true /> </autoHighlight>
<sharedHighlight> <true /> </sharedHighlight>
<family>0</family>
<titleWidth>0</titleWidth>
<icon>25002</icon>
<textAlign>center</textAlign>
<font>Chicago</font>
<textSize>12</textSize>
<textStyle>plain</textStyle>
<name>Help</name>
<script>on mouseUpif visible of cd fld "Help" thenhide cd fld helpset hilite of me to falseelseshow cd fld helpset hilite of me to trueend ifend mouseUp</script>
</part>
<part>
<id>13</id>
<type>field</type>
<visible> <true /> </visible>
<dontWrap> <false /> </dontWrap>
<dontSearch> <false /> </dontSearch>
<sharedText> <false /> </sharedText>
<fixedLineHeight> <false /> </fixedLineHeight>
<autoTab> <false /> </autoTab>
<lockText> <true /> </lockText>
<rect>
<left>222</left>
<top>175</top>
<right>252</right>
<bottom>193</bottom>
</rect>
<style>transparent</style>
<autoSelect> <false /> </autoSelect>
<showLines> <false /> </showLines>
<wideMargins> <false /> </wideMargins>
<multipleLines> <false /> </multipleLines>
<reservedFamily> 0 </reservedFamily>
<titleWidth>0</titleWidth>
<icon>0</icon>
<textAlign>right</textAlign>
<font>Geneva</font>
<textSize>10</textSize>
<textStyle>plain</textStyle>
<textHeight>13</textHeight>
<name>bar feedback</name>
<script>on feedback Xif X Γëá empty thenset style of me to "Rect"put (X-left of cd button "bar index") DIV 10 into meelseput empty into meset style of me to "Transparent"end ifend feedbackon newLeft Xset left of me to Xend newLeft</script>
</part>
<part>
<id>17</id>
<type>button</type>
<visible> <true /> </visible>
<reserved5> 0 </reserved5>
<reserved4> 0 </reserved4>
<reserved3> 0 </reserved3>
<reserved2> 0 </reserved2>
<reserved1> 0 </reserved1>
<enabled> <true /> </enabled>
<rect>
<left>201</left>
<top>306</top>
<right>309</right>
<bottom>328</bottom>
</rect>
<style>roundrect</style>
<showName> <true /> </showName>
<highlight> <false /> </highlight>
<autoHighlight> <true /> </autoHighlight>
<sharedHighlight> <true /> </sharedHighlight>
<family>0</family>
<titleWidth>0</titleWidth>
<icon>0</icon>
<textAlign>center</textAlign>
<font>Chicago</font>
<textSize>12</textSize>
<textStyle>plain</textStyle>
<name>Roll</name>
<script>on mouseUpsend "setValue" && random(24)-12 to cd fld "model"end mouseUp</script>
</part>
<part>
<id>18</id>
<type>button</type>
<visible> <true /> </visible>
<reserved5> 0 </reserved5>
<reserved4> 0 </reserved4>
<reserved3> 0 </reserved3>
<reserved2> 0 </reserved2>
<reserved1> 0 </reserved1>
<enabled> <true /> </enabled>
<rect>
<left>199</left>
<top>227</top>
<right>310</right>
<bottom>251</bottom>
</rect>
<style>rectangle</style>
<showName> <true /> </showName>
<highlight> <false /> </highlight>
<autoHighlight> <false /> </autoHighlight>
<sharedHighlight> <true /> </sharedHighlight>
<family>0</family>
<titleWidth>0</titleWidth>
<icon>0</icon>
<textAlign>center</textAlign>
<font>Chicago</font>
<textSize>12</textSize>
<textStyle>plain</textStyle>
<name>Dice view</name>
<script>on Updateput abs(card field "model") into counterValueif counterValue Γëñ 12 thenget (counterValue div 2)put rand(it, min(countervalue-1,6)) into Die1put counterValue-Die1 into Die2set the icon of card button "Die 1" to "Dice,"&Die1set the icon of card button "Die 2" to "Dice,"&Die2elseset the icon of card button "Die 1" to emptyset the icon of card button "Die 2" to emptyend ifget card field "model" < 0set hilite of card button "Die 1" to itset hilite of card button "Die 2" to itend Updatefunction rand i,j-- returns a random integer in the interval i to jreturn random(j-i+1)-1+iend rand</script>
</part>
<part>
<id>19</id>
<type>button</type>
<visible> <true /> </visible>
<reserved5> 0 </reserved5>
<reserved4> 0 </reserved4>
<reserved3> 0 </reserved3>
<reserved2> 0 </reserved2>
<reserved1> 0 </reserved1>
<enabled> <true /> </enabled>
<rect>
<left>211</left>
<top>260</top>
<right>246</right>
<bottom>295</bottom>
</rect>
<style>transparent</style>
<showName> <false /> </showName>
<highlight> <false /> </highlight>
<autoHighlight> <false /> </autoHighlight>
<sharedHighlight> <true /> </sharedHighlight>
<family>0</family>
<titleWidth>0</titleWidth>
<icon>2105</icon>
<textAlign>center</textAlign>
<font>Chicago</font>
<textSize>12</textSize>
<textStyle>plain</textStyle>
<name>Die 1</name>
<script></script>
</part>
<part>
<id>20</id>
<type>button</type>
<visible> <true /> </visible>
<reserved5> 0 </reserved5>
<reserved4> 0 </reserved4>
<reserved3> 0 </reserved3>
<reserved2> 0 </reserved2>
<reserved1> 0 </reserved1>
<enabled> <true /> </enabled>
<rect>
<left>260</left>
<top>260</top>
<right>295</right>
<bottom>295</bottom>
</rect>
<style>transparent</style>
<showName> <false /> </showName>
<highlight> <false /> </highlight>
<autoHighlight> <false /> </autoHighlight>
<sharedHighlight> <true /> </sharedHighlight>
<family>0</family>
<titleWidth>0</titleWidth>
<icon>2103</icon>
<textAlign>center</textAlign>
<font>Chicago</font>
<textSize>12</textSize>
<textStyle>plain</textStyle>
<name>Die 2</name>
<script></script>
</part>
<part>
<id>11</id>
<type>field</type>
<visible> <false /> </visible>
<dontWrap> <false /> </dontWrap>
<dontSearch> <false /> </dontSearch>
<sharedText> <false /> </sharedText>
<fixedLineHeight> <false /> </fixedLineHeight>
<autoTab> <false /> </autoTab>
<lockText> <true /> </lockText>
<rect>
<left>98</left>
<top>0</top>
<right>468</right>
<bottom>325</bottom>
</rect>
<style>shadow</style>
<autoSelect> <false /> </autoSelect>
<showLines> <false /> </showLines>
<wideMargins> <true /> </wideMargins>
<multipleLines> <false /> </multipleLines>
<reservedFamily> 0 </reservedFamily>
<titleWidth>0</titleWidth>
<icon>0</icon>
<textAlign>left</textAlign>
<font>Geneva</font>
<textSize>10</textSize>
<textStyle>plain</textStyle>
<textHeight>13</textHeight>
<name>Help</name>
<script>on mouseUpsend "mouseUp" to cd button "Help"end mouseUp</script>
<text><span class="style2">VC Simulation v3</span><span class="style1">George Coulouris, October 1990(george@cs.qmw.ac.uk)A simulation of a Counter with multiple views implemented according to the Model-View-Controller paradigm.There are four views:ΓÇó the Numeric View shows the counter value in numeric formΓÇó the Bar View indicates the value and sign of the counter value by the length of a barΓÇó the dial view indicates the counter value by the angle of the 'needle'ΓÇó the dice view!There are four controllers:ΓÇó the Counter menu (in the menu bar)ΓÇó the arrows beside the numeric view (click them)ΓÇó the arrow below the bar view (drag it)ΓÇó the "Roll" button gives the counter a random valueOpen the script of an object to see its behaviour. The scripts correspond as closely as possible to the behaviour of MVC described in the paper.</span></text>
</content>
<name></name>
<script>on openCardcreate menu "Counter"put "Increment,Decrement" into menu "Counter"set commandChar of menuItem "Increment" of menu "Counter" to "I"set commandChar of menuItem "Decrement" of menu "Counter" to "D"set menuMessage of menuItem "Increment" of menu "Counter" to "Increment"set menuMessage of menuItem "Decrement" of menu "Counter" to "Decrement"pass openCardend openCardon closeCarddelete menu "Counter"pass closeCardend closeCardon Incrementsend "Increment" to card field "Model"end Incrementon Decrementsend "Decrement" to card field "Model"end Decrement</script>